package test02;

/**
 * @author ZQX
 * @date 2025-04-09
 */
public class MainTest02 {
    public static void main(String[] args) {

        // 根据枚举常量名称，返回枚举实例
        Color color01 = Color.valueOf("RED");
        Color color02 = Color.valueOf(Color.class,"RED");
        // Color color02 = Enum.valueOf(Color.class,"RED");

        System.out.println(color01.getValue());
        System.out.println(color02.getValue());
    }
}
